package com.lnb.mapper;

import com.lnb.entity.Modules;

import java.util.List;

import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liningbo
 * @since 2020-05-21
 */
public interface ModulesMapper extends BaseMapper<Modules> {

	@Select("select  module_id FROM role_modules WHERE role_id =#{rid}")
	public List<Integer> getModulesTreeByRoleId(Integer rid); 	

	@Select("select * from modules where id in"
	+"(select module_id from role_modules where role_id in"
	+"(select role_id from user_roles where user_id = #{rid}))")
	public List<Modules> getModulesListByRoleId(Integer uid);

	public List<Modules> getModulesListByUserId(Integer uid);

		
	
}
